package com.study.shengsiyuan.example10;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class OldIOServer {
	public static void main(String[] args) throws IOException{
		ServerSocket  serverSocket = new ServerSocket(8899);
		while(true) {
			Socket socket = serverSocket.accept();
			DataInputStream dataInputStream =new DataInputStream(socket.getInputStream());
			try {
				byte[] byteArray = new byte[4096];

				while(true) {
					int readCount = dataInputStream.read(byteArray,0,byteArray.length);
					if(readCount ==-1) { break; }
				}
			}catch (Exception e) {
				// TODO: handle exception
			}
		}

	}
}
